#include <iostream>
using namespace std;

int main()
{
	int n, m;
	cin >> n;
	while (n-- && cin >> m) {
		int tot = 1 - m;
		for (int tmp; m-- && cin >> tmp; tot += tmp);
		cout << tot << endl;
	}
	return 0;
}
